import React, { Component } from 'react'
import './Navigation.css'
import { Menu } from 'antd';
const { SubMenu } = Menu;

export default class Navigation extends Component {

    render() {
        return (
            <Menu
                defaultSelectedKeys={this.props.bases[0].items[0].cid.toString()}
                defaultOpenKeys={['0']}
                mode="inline"
            >
                {this.props.bases.map((item_sub,index_sub)=>{
                    return  <SubMenu key={index_sub} title={item_sub.baseName}>
                                {item_sub.items.map((item,index)=>{
                                    return <Menu.Item key={item.cid} onClick={()=>this.props._navigation_callBack(index_sub,index)}>{item.name}</Menu.Item>
                                })}
                            </SubMenu>
                })}
            </Menu>
        )
    }

}
